package lab02.Test31;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/11/3.
 */
public class Test31 {
    public static void main(String[] args) {
        List<String> names = new ArrayList<String>();
        names.add("张三");
        names.add("李四");
        names.add("王五");
        names.add("马六");
        names.add("赵七");
        for (String str : names ){
            System.out.println(names.indexOf(str));
            System.out.println(str);
        }

        System.out.println("集合的大小是："+names.size());
        names.remove(2);

        System.out.println("第三个元素："+names.get(2));
        System.out.println("集合大小："+names.size());

    }
}